﻿using System.Data;

namespace TurtleEngine
{
	 /// <summary>
	 ///
	 /// </summary>
	 public class ForeignKeysHelper
	 {
		  /// <summary>
		  /// The foreign keys
		  /// </summary>
		  private static DataTable foreignKeys = new DataTable("ForeignKeys");

		  /// <summary>
		  /// Gets the foreign keys.
		  /// </summary>
		  /// <value>
		  /// The foreign keys.
		  /// </value>
		  public static DataTable ForeignKeys
		  {
				get { return foreignKeys; }
		  }

		  /// <summary>
		  /// Gets the foreign keys.
		  /// </summary>
		  public static void GetForeignKeys()
		  {
				foreignKeys.Clear();
				foreignKeys = Utility.DBConnection.GetSchema("ForeignKeys");

				//Utility.PrintDatatable(foreignKeys);
		  }

		  /// <summary>
		  /// Writes the foreign keys.
		  /// </summary>
		  public static void WriteForeignKeys()
		  {
				Utility.WriteXML(foreignKeys, foreignKeys.TableName + ".xml");

				//Utility.PrintDatatable(foreignKeys);
		  }
	 }
}